********************************************************************************
** 	TITLE: b7_3_casenumbers_saginaw_repull.do
**
**	PROJECT: IGNITE
** 
**  PURPOSE: This File Repulls the Saginaw Criminal Cases (both pre-covid criminal 
**	and post-covid criminal cases) that had incorrectly pulled information. 

********************************************************************************	
		set sortseed 13

 	use "$output_data/saginaw_roa_postcrim_parsed.dta", clear
	gen post_cov = 1
	append using "$output_data/saginaw_roa_precrim_parsed.dta"
	unab vli_all : *
	replace post_cov = 0 if missing(post_cov)
	
	gen incorrect = (!missing(roa_case_id) &  missing(case_status))
	
	codebook incorrect
	//791  1 incorrectly parsed. 

tempfile text 

saveold `text', replace

	keep if incorrect & !post_cov
	
	keep case_id
	
export delimited using "$output_data/sag_case_precrim_repull.txt", replace

use `text', clear

	keep if incorrect & post_cov
	
	keep case_id

export delimited using "$output_data/sag_case_postcrim_repull.txt", replace
